#
# Copyright (c) 2022 Winsider Seminars & Solutions, Inc.  All rights reserved.
#
# This file is part of System Informer.
#

set(SI_C_FLAGS_INIT ${SI_C_STANDARD_FLAG} ${SI_COMPILE_FLAGS_INIT})
set(SI_C_FLAGS_DEBUG_INIT ${SI_COMPILE_FLAGS_DEBUG_INIT})
set(SI_C_FLAGS_RELEASE_INIT ${SI_COMPILE_FLAGS_RELEASE_INIT})
set(SI_CXX_FLAGS_INIT ${SI_CXX_STANDARD_FLAG} ${SI_COMPILE_FLAGS_INIT})
set(SI_CXX_FLAGS_DEBUG_INIT ${SI_COMPILE_FLAGS_DEBUG_INIT})
set(SI_CXX_FLAGS_RELEASE_INIT ${SI_COMPILE_FLAGS_RELEASE_INIT})
set(SI_EXE_LINKER_FLAGS_INIT ${SI_LINK_FLAGS_INIT})
set(SI_EXE_LINKER_FLAGS_DEBUG_INIT ${SI_LINK_FLAGS_DEBUG_INIT})
set(SI_EXE_LINKER_FLAGS_RELEASE_INIT ${SI_LINK_FLAGS_RELEASE_INIT})
set(SI_SHARED_LINKER_FLAGS_INIT ${SI_LINK_FLAGS_INIT})
set(SI_SHARED_LINKER_FLAGS_DEBUG_INIT ${SI_LINK_FLAGS_DEBUG_INIT})
set(SI_SHARED_LINKER_FLAGS_RELEASE_INIT ${SI_LINK_FLAGS_RELEASE_INIT})
set(SI_MODULE_LINKER_FLAGS_INIT ${SI_LINK_FLAGS_INIT})
set(SI_MODULE_LINKER_FLAGS_DEBUG_INIT ${SI_LINK_FLAGS_DEBUG_INIT})
set(SI_MODULE_LINKER_FLAGS_RELEASE_INIT ${SI_LINK_FLAGS_RELEASE_INIT})
set(SI_STATIC_LINKER_FLAGS_INIT ${SI_STATIC_LINK_FLAGS_INIT})
set(SI_STATIC_LINKER_FLAGS_DEBUG_INIT ${SI_STATIC_LINK_FLAGS_DEBUG_INIT})
set(SI_STATIC_LINKER_FLAGS_RELEASE_INIT ${SI_STATIC_LINK_FLAGS_RELEASE_INIT})

macro(_si_set_init _suffix)
    set(__joined)
    list(JOIN SI_${_suffix}_INIT " " __joined)
    set(CMAKE_${_suffix} "${__joined}")
endmacro()

_si_set_init(C_FLAGS)
_si_set_init(C_FLAGS_DEBUG)
_si_set_init(C_FLAGS_RELEASE)
_si_set_init(CXX_FLAGS)
_si_set_init(CXX_FLAGS_DEBUG)
_si_set_init(CXX_FLAGS_RELEASE)
_si_set_init(EXE_LINKER_FLAGS)
_si_set_init(EXE_LINKER_FLAGS_DEBUG)
_si_set_init(EXE_LINKER_FLAGS_RELEASE)
_si_set_init(SHARED_LINKER_FLAGS)
_si_set_init(SHARED_LINKER_FLAGS_DEBUG)
_si_set_init(SHARED_LINKER_FLAGS_RELEASE)
_si_set_init(MODULE_LINKER_FLAGS)
_si_set_init(MODULE_LINKER_FLAGS_DEBUG)
_si_set_init(MODULE_LINKER_FLAGS_RELEASE)
_si_set_init(STATIC_LINKER_FLAGS)
_si_set_init(STATIC_LINKER_FLAGS_DEBUG)
_si_set_init(STATIC_LINKER_FLAGS_RELEASE)
